package com.candykingdom.pages
{
	import com.app.components.Scroll;
	
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.geom.Rectangle;
	
	public class PageKingdom extends PageBase
	{
		public function PageKingdom()
		{
			super();
			var mmcc:DisplayObject = this.getChildByName("mc");
			var scroll:Scroll = new Scroll(new Rectangle(0 ,0 ,640 ,1120) 
				,new Rectangle(mmcc.x ,mmcc.y ,640 ,mmcc.height)
				,Scroll.VERTICAL);
			addChild(scroll);
			scroll.x = mmcc.x;
			scroll.y = mmcc.y;
			scroll.addChild(mmcc);
			mmcc.x = mmcc.y = 0;
			
			var msk:Sprite = new Sprite();
			msk.graphics.beginFill(0 ,0);
			msk.graphics.drawRect(0 ,0 ,640 ,1120);
			msk.graphics.endFill();
			addChild(msk);
			msk.x = scroll.x;
			msk.y = scroll.y;
			scroll.mask = msk;
		}
	}
}